package com.gwq.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.gwq.base.AutoEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author gwq
 * @since 2022-06-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysUser extends AutoEntity<SysUser> {


    @ApiModelProperty("用户名")
    @NotBlank(message = "用户名不能为空")
    private String userName;

    @ApiModelProperty("密码")
//    @NotBlank(message = "密码不能为空")
    private String password;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("邮箱")
//    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    @ApiModelProperty("城市(暂未使用)")
    private String city;

    @ApiModelProperty("手机号码")
    private String phone;

    @ApiModelProperty("最后一次登录时间(暂未使用)")
    private LocalDateTime lastLogin;

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("用户类型")
    @TableField(exist = false)
    private Integer userType;

    @TableField(exist = false)
    private List<SysRole> sysRoles = new ArrayList<>();

}
